<% /* $Id: languages.jsp 132 2011-08-26 10:23:42Z altdotua@gmail.com $ */ %>

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>

<%@ include file="../header.jsp" %>

<h2 align="center"><%= bundle.getString("W_CONTESTLANGUAGES") %></h2>

<table>
	<tr>
		<th>ID</th>
		<th>Sid</th>
		<th><%= bundle.getString("W_NAME") %></th>
	</tr>
	
<%
	
	List<LanguageEntry> entries = ContestLanguagesModel.getContestEntries(contest.getId());
	for (LanguageEntry entry: entries)
	{
%>
	<tr>
		<td><%= entry.getId() %></td>
		<td><%= entry.getSid() %></td>
		<td><%= entry.getName() %></td>
	</tr>
<%
	}
%>
	
</table>



<%
	if (!contest.getAllowAllLanguages())
	{
%>
<h2>Add language</h2>

<form action="<%= Linker.link("contestlanguages") %>" method="post">
	<input type="hidden" name="action" value="edit">
	<input type="hidden" name="contestId" value="<%= contest.getId() %>">
	<p>Language<select name="languageId">
<%
	List<LanguageEntry> languages = LanguagesModel.getAllEntries();
	for (LanguageEntry language : languages)
	{
%>
		<option value="<%= language.getId()%>"><%= language %> 
<%
 	}
%>
	</select></p>  
	<p><input type="checkbox" name="active" checked="checked">Active?</p>
	<p><input type="submit" value="Submit"></p>
</form>

<%
	}
%>

<%@include file="../footer.jsp"%>
